package com.briup.common.response;

/**
 * @Description：代码和消息枚举
 * @Author：qinyc
 * @Date：2024/07/03 10:30:25
 * @Version：1.0.0
 */
public enum CodeAndMessageEnum {
    SUCCESS(200,"操作成功"),
    ERROR(500,"系统内部异常"),

    /**
     * 1001 - 1099 用户层面异常
     */
    USERNAME_IS_NOT_NULL(1001,"用户名信息不能为空"),
    PASSWORD_IS_NOT_NULL(1002,"密码不能为空"),
    DUPLICATE_USERNAMES(1003,"用户名重复"),
    USERNAME_INFORMATION_IS_ERROR(1004,"用户名信息错误"),
    PASSWORD_INFORMATION_IS_ERROR(1005,"密码信息错误"),
    //登录过期
    USER_LOGIN_TIMEOUT(505, "用户身份登录过期"),
    JSON_WEB_TOKEN_INVALID(1006,"登录过期，令牌无效"),
    NWE_PASSWORD_CONFIRM_PASSWORD_INCONSISTENT(1007,"新密码与确认密码不一致"),
    OLD_PASSWORD_DB_PASSWORD_INCONSISTENT(1008,"旧密码与数据库保存的密码不一致"),
    /**
     * 2001 - 2099 工具类异常
     */
    COPY_BEAN_ERROR(2001,"对象拷贝异常"),


    /**
     * 收藏相关异常 3001 - 3099
     */
    COLLECT_IDS_IS_NULL(3001,"收藏ID不能为空"),
    //库存不足
    GOODSTOCK_IS_NOT_ENOUGH(3002,"库存不足"),


    /**
     * 购物车相关异常 4001 -4099
     */
    SHOP_CAR_ID_IS_NULL(4001,"购物车ID不能为空"),
    SHOP_CAR_NUM_IS_ERROR(4002,"购物车商品数量格式错误"),
    SHOP_CAR_IDS_IS_ERROR(4003,"购物车ID格式错误"),
    SHOP_CAR_IS_FULL(4004,"购物车数量已满"),


    /**
     * 收货地址相关异常 5001 - 5099
     */
    DEFAULT_ADDRESS_IS_EXIST(5001,"默认收货地址已存在"),


    /**
     * 订单相关异常 6001 - 6099
     */
    ORDER_INFO_IS_NULL(6001,"订单信息不能为空"),
    ORDER_ITEM_INFO_IS_NULL(6002,"订单项信息不能为空"),
    RECEIVE_USERNAME_IS_NULL(6003,"收件人信息不能为空"),
    ORDER_ID_IS_NULL(6004,"订单ID为空"),
    ORDER_HAS_BEEN_PAID(6005,"订单已完成支付，无法关闭"),
    INSUFFICIENT_BALANCE(6006,"账号余额不足，请充值..."),
    ;


    /**
     * FieldType：@see Integer
     * Description: 响应状态码
     */
    private Integer code;

    /**
     * FieldType：@see String
     * Description: 响应消息
     */
    private String message;

    CodeAndMessageEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    public Integer getCode() {
        return code;
    }
    public String getMessage() {
        return message;
    }
}
